---------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
 opened on:  16 Dec 2021, 15:39:13

. use HOD_Dec_2021

. gen creation=1

. 
. collapse (sum) creation, by(COUNTHQ)

. log off
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
 paused on:  16 Dec 2021, 15:40:42
---------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
resumed on:  16 Dec 2021, 15:41:07

. rename COUNTHQ ccode

. 
. merge 1:1 ccode using trans
(note: variable ccode was int, now float to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                            21
        from master                         2  (_merge==1)
        from using                         19  (_merge==2)

    matched                               176  (_merge==3)
    -----------------------------------------

. 
. drop if id==.
(2 observations deleted)

. 
. drop _merge

. 
. merge 1:1 id using usdb

    Result                           # of obs.
    -----------------------------------------
    not matched                            51
        from master                         0  (_merge==1)
        from using                         51  (_merge==2)

    matched                               195  (_merge==3)
    -----------------------------------------

. 
. drop if _merge!=3
(51 observations deleted)

. 
. spmap creation using uscoord, id(id) fcolor(Blues) clmethod(custom) clbreaks (1 2 5 10 50 100 363)

. use HOD_Dec_2021.dta, clear

. 
. tab type

       type |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |         96        3.94        3.94
          2 |         96        3.94        7.88
          3 |        996       40.89       48.77
          4 |        637       26.15       74.92
          5 |        133        5.46       80.38
          6 |         70        2.87       83.25
          7 |        111        4.56       87.81
          8 |        152        6.24       94.05
         10 |          2        0.08       94.13
         11 |         94        3.86       97.99
         12 |         49        2.01      100.00
------------+-----------------------------------
      Total |      2,436      100.00

. gen creation=1

. 
. collapse (sum) creation, by(year)

. log off
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
 paused on:  16 Dec 2021, 15:42:27
---------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
resumed on:  16 Dec 2021, 15:42:55

. drop if year==.
(1 observation deleted)

. 
. twoway (line creation year if year>1844, sort), ylabel(0(10)80) xlabel(1845(5)2017)

. use HOD_Dec_2021.dta, clear

. 
. gen creation=1

. 
. graph bar (sum) creation if year>1944, over(REGHQ) over(year) asyvars stack

. asdoc tab subtype REGHQ if type==3 | type==4, column
(File Myfile.doc already exists, option append was assumed)

+-------------------+
| Key               |
|-------------------|
|     frequency     |
| column percentage |
+-------------------+

           |                                    REGHQ
   subtype |         1          2          3          4          5          6          7 |     Total
-----------+-----------------------------------------------------------------------------+----------
        31 |         1          0          1          8          9         13          0 |        32 
           |      0.36       0.00       0.16       6.35       3.91       4.92       0.00 |      2.01 
-----------+-----------------------------------------------------------------------------+----------
        32 |        28          6         43         51         69        105          3 |       305 
           |     10.14      13.64       7.05      40.48      30.00      39.77       6.82 |     19.13 
-----------+-----------------------------------------------------------------------------+----------
        33 |        15          0         14         22         23         15          0 |        89 
           |      5.43       0.00       2.30      17.46      10.00       5.68       0.00 |      5.58 
-----------+-----------------------------------------------------------------------------+----------
        34 |       181          3        278         19          8         47         14 |       550 
           |     65.58       6.82      45.57      15.08       3.48      17.80      31.82 |     34.50 
-----------+-----------------------------------------------------------------------------+----------
        40 |         4          0         23          1          1          0          0 |        29 
           |      1.45       0.00       3.77       0.79       0.43       0.00       0.00 |      1.82 
-----------+-----------------------------------------------------------------------------+----------
        41 |         4          0         21          0          2          1          0 |        28 
           |      1.45       0.00       3.44       0.00       0.87       0.38       0.00 |      1.76 
-----------+-----------------------------------------------------------------------------+----------
        42 |         9          1         62          0          0          1          8 |        81 
           |      3.26       2.27      10.16       0.00       0.00       0.38      18.18 |      5.08 
-----------+-----------------------------------------------------------------------------+----------
        43 |        28         26        144         14         95         65         12 |       384 
           |     10.14      59.09      23.61      11.11      41.30      24.62      27.27 |     24.09 
-----------+-----------------------------------------------------------------------------+----------
        44 |         6          8         24         11         23         17          7 |        96 
           |      2.17      18.18       3.93       8.73      10.00       6.44      15.91 |      6.02 
-----------+-----------------------------------------------------------------------------+----------
     Total |       276         44        610        126        230        264         44 |     1,594 
           |    100.00     100.00     100.00     100.00     100.00     100.00     100.00 |    100.00 
Click to Open File:  Myfile.doc

. log close
      name:  <unnamed>
       log:  C:\Users\Clara\Dropbox\Publications\hod_ JPR\Final_ISQ\Revisions\Final submission files\Final accepted\LOGS\HOD_Log_datavi
> ztable.log
  log type:  text
 closed on:  16 Dec 2021, 15:44:17
---------------------------------------------------------------------------------------------------------------------------------------
